
package tsp;

import java.util.Comparator;

public class CostComparator implements Comparator<Object>{

    @Override
    public int compare(Object tsp_sol1, Object tsp_sol2) {

        int coutSolution1 = ((TSP_Solution)tsp_sol1).getCoutSolution();
        int coutSolution2 = ((TSP_Solution)tsp_sol2).getCoutSolution();

        if(coutSolution1 > coutSolution2)
            return 1;
        else if(coutSolution1 < coutSolution2)
            return -1;
        else
            return 0;
        
    }

}
